Fix Windows 32KB command-line limit for agent prompts#269
Conversation
Four agents (copilot, cursor, droid, opencode) passed prompts as CLI arguments, which hits the 32,766-char CreateProcess limit on Windows. Switch all four to stdin piping. Also switch gh pr comment from --body to --body-file - for the same reason. Add --large-prompt flag to check-agents for validating the fix with a 33KB+ prompt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cursor CLI does not support stdin piping — revert to positional arg. Add cmd.WaitDelay = 5s to all agents that use StdoutPipe (claude, codex, cursor, gemini). When CommandContext kills a process, child processes can keep stdout pipes open, causing pipe reads to block forever. WaitDelay (Go 1.20+) force-closes pipes after the grace period, preventing the hang observed with gemini under --large-prompt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cursor CLI does support stdin when no positional arg is given. The earlier revert was based on a stale binary that hadn't been rebuilt after the initial stdin change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0fc5144 to
ca7299f
Compare
roborev: Combined ReviewVerdict: Changes are directionally good, but there are 3 Medium-severity issues to address before merge. Medium
Synthesized from 4 reviews (agents: codex, gemini | types: security, default) |
roborev: Combined ReviewVerdict: Changes are mostly positive, but there are 2 Medium-severity functional regressions to address before merge. Medium
Notes
Synthesized from 4 reviews (agents: gemini, codex | types: security, default) |
Update cursor.go comment to reflect stdin piping (not positional arg). Add TestReviewPipesPromptViaStdin for copilot, cursor, droid, and opencode agents to verify prompts are delivered via stdin and never leak into argv. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined ReviewPotential regression risk identified: 1 Medium issue; no Critical/High findings and no new security vulnerabilities reported. Medium
Synthesized from 4 reviews (agents: codex, gemini | types: security, default) |
|
Merging this. check-agents with stdin piping works correctly here, but if there are any regressions around this I'll certainly patch them ASAP |
## Summary - Switch copilot, cursor, droid, and opencode agents from CLI arguments to stdin piping for prompt delivery, avoiding the Windows `CreateProcess` 32,766-character limit - Switch `gh pr comment` from `--body` to `--body-file -` with stdin piping for the same reason - Add `cmd.WaitDelay = 5s` to all pipe-based agents (claude, codex, cursor, gemini) so context cancellation reliably terminates pipe reads when child processes outlive the parent - Add `--large-prompt` flag to `check-agents` for validating the fix with a 33KB+ prompt ## Test plan - [x] `go test ./...` passes - [x] `roborev check-agents` — all agents pass - [x] `roborev check-agents --large-prompt` — agents that support large prompts pass Closes roborev-dev#266 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
CreateProcess32,766-character limitgh pr commentfrom--bodyto--body-file -with stdin piping for the same reasoncmd.WaitDelay = 5sto all pipe-based agents (claude, codex, cursor, gemini) so context cancellation reliably terminates pipe reads when child processes outlive the parent--large-promptflag tocheck-agentsfor validating the fix with a 33KB+ promptTest plan
go test ./...passesroborev check-agents— all agents passroborev check-agents --large-prompt— agents that support large prompts passCloses #266
🤖 Generated with Claude Code